import java.util.Locale;
import java.util.Scanner;

public class Test {
        //检测字符串是否为回文
        public boolean isPalindrome(String s) {
            s = s.toLowerCase();
            int i = 0;
            int j = s.length() - 1;
            while(i < j) {
                while(i < j && !isNumOrCharacter(s.charAt(i))) {
                    i++;
                }
                while(i < j && !isNumOrCharacter(s.charAt(j))) {
                    j--;
                }
                if(s.charAt(i) == s.charAt(j)) {
                    i++;
                    j--;
                }else {
                    return false;
                }
            }
            return true;
        }
    private boolean isNumOrCharacter(char ch) {
        if(ch >= '0' && ch <= '9' || ch >= 'a' && ch <= 'z') {
            return true;
        }
        return false;
    }

    public static int lastWordLength(String str) {
        String[] ret = str.split(" ");
        return ret[ret.length-1].length();
    }
    public static int lastWordLength2(String str) {
        int index = str.lastIndexOf(" ");
        String ret = str.substring(index+1);
        return ret.length();
    }
    public static void main8(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String str = scanner.nextLine();
        int ret = lastWordLength(str);
        int ret2 = lastWordLength2(str);
        System.out.println(ret);
        System.out.println(ret2);
    }
    public static void main7(String[] args) {
        String str = "2024.07.27";
        String[] ret = str.split("\\.");
        for (int i = 0; i < ret.length; i++) {
            System.out.println(ret[i]);
        }
    }
    public static void main6(String[] args) {
        String str = "ab\\cde\\kfg";
        String[] ret = str.split("\\\\");
        for (int i = 0; i < ret.length; i++) {
            System.out.println(ret[i]);
        }
    }
    public static void main5(String[] args) {
        String str = "name=aoteman&age=10000";
        String[] ret = str.split("=|&");
        for (int i = 0; i < ret.length; i++) {
            System.out.println(ret[i]);
        }
    }
    public static void main4(String[] args) {
        String str = "name=aoteman&age=10000";
        String[] ret = str.split("=",2);
        for (int i = 0; i < ret.length; i++) {
            System.out.println(ret[i]);
        }
    }
    public static void main3(String[] args) {
        String str = "name=aoteman&age=10000";
        String[] ret = str.split("=");
        for (int i = 0; i < ret.length; i++) {
            System.out.println(ret[i]);
        }
    }
    public static void main2(String[] args) {
        String str = "aabbccddeeffaabb";
        String ret = str.replace('a','k');
        String ret2 = str.replace("aabb","6666");
        String ret3 = str.replaceFirst("aa","LL");
        System.out.println(str);
        System.out.println(ret);
        System.out.println(ret2);
        System.out.println(ret3);
    }
    public static void main1(String[] args) {
        String str1 = new String("123");
        String str2 = new String("123.4");
        int num1 = Integer.parseInt(str1);
        double num2 = Double.parseDouble(str2);
        System.out.println(num1+1);
        System.out.println(num2+0.1);
        String str3 = "abCDef";
        String str4 = "stuDeNT";
        String ret = str3.toLowerCase();
        String ret2 = str4.toUpperCase();
        System.out.println(str3);
        System.out.println(ret);
        System.out.println(ret2);
    }
}
